home *** CD-ROM | disk | FTP | other *** search
/ TeX 1995 July / TeX CD-ROM July 1995 (Disc 1)(Walnut Creek)(1995).ISO / macros / plain / contrib / outline.sty < prev    next >
Encoding:
Text File  |  1992-08-26  |  2.7 KB  |  80 lines

  1. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  2. %                  outline.sty -- Outline Style
  3. %                           Hal R. Varian
  4. %                          September, 1987
  5. %
  6. %  Reads structured files generated by PC-OUTLINE and formats them
  7. %  in TeX.  Before using you must use a global search and replace command
  8. %  to change all strings of ".HEAD" to "\HEAD".  Then load outline.sty
  9. %  and TeX the outline file.
  10. %
  11. %  Notes
  12. %  1. To generate the outline, choose "Send to structured file" from the
  13. %     device menu in the print routine of PC-OUTLINE.
  14. %  2. The title must be indicated manually using \title.  It is usually
  15. %     indicated by a .HEAD 1
  16. %  3. Sometimes the structured file ends with a spurious .HEAD 1 which should
  17. %     be removed.
  18. %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
  19.      
  20. %for title
  21. \def\title#1{\centerline{\bf #1}\medskip}
  22.      
  23. %use \count11 thru \count18 for counters for levels 1 thru 8
  24.      
  25. \count11=0
  26. \count12=0
  27. \count13=0
  28. \count14=0
  29. \count15=0
  30. \count16=0
  31. \count17=0
  32. \count18=0
  33.      
  34. %create registers for levels, etc.
  35.      
  36. \newcount\CurrentLevel\CurrentLevel=0
  37. \newcount\LastLevel\LastLevel=0
  38. \newcount\CurrentCounter\CurrentCounter=1
  39. \newcount\CharCode\CharCode=96
  40.      
  41. %\Indentation measures the amount of indentation
  42. \newdimen\Indentation\Indentation=3ex
  43.      
  44. %skip between level 1 headings
  45. \def\AdjustSpace{\vskip -.5pc}
  46.      
  47. \parindent=0pt
  48. \parskip=0pt
  49.      
  50. \def\HEAD #1 {%
  51. \par
  52. \CurrentLevel=#1
  53. \CurrentCounter=#1
  54. \advance\CurrentCounter by 10         %level 1 is assigned to register 11, etc.
  55. \ifnum\CurrentLevel>\LastLevel                %if sublevel,
  56.    \count\CurrentCounter=1                    %reset \CurrentCounter,
  57.    \else\advance\count\CurrentCounter by 1\fi %otherwise, increment
  58. \LastLevel=\CurrentLevel
  59. \filbreak     %helps prevent entries from being split between pages
  60. \hskip\CurrentLevel\Indentation
  61. \CharCode=\number\count\CurrentCounter  %for lettered levels
  62. \let\NumCode=\CharCode                  %for numbered levels
  63. \ifcase#1%
  64. \relax\or                               %there is no level zero
  65.    \AdjustSpace\advance\CharCode by 64
  66. \Item\char\CharCode.\space\or           %level 1: A.
  67. \Item\llap{\number\NumCode.\space}\or   %level 2: 1.
  68.    \advance\CharCode by 96
  69. \Item\llap{\char\CharCode)\space}\or    %level 3: a)
  70. \Item\llap{\number\NumCode)\space}\or   %level 4: 1)
  71.    \advance\CharCode by 96
  72. \Item\llap{\char\CharCode$>$\space}\or  %level 5: a>
  73. \Item\llap{\number\NumCode$>$\space}\or %level 6: 1>
  74.    \advance\CharCode by 96
  75. \Item\llap{\char\CharCode:\space}\or    %level 7: a:
  76. \Item\llap{\number\NumCode:\space}\fi}  %level 8: 1:
  77.      
  78. \def\Item{\hangindent\CurrentLevel\Indentation}
  79. %%%-Incise----------------------------------------------------------
  80.